package com.nd.qa.shareplate;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class Task {
  public static void main(String[] args) {
    Runnable runnable = new Runnable() {
      public void run() {
        // task to run goes here
        System.out.println("Hello !!");
      }
    };
    ScheduledExecutorService service = Executors
                    .newSingleThreadScheduledExecutor();
    //command：执行线程
    //initialDelay：初始化延时
    //period：两次开始执行最小间隔时间
    //unit：计时单位
    service.scheduleAtFixedRate(runnable, 0, 100, TimeUnit.SECONDS);
  }
}
